<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

        <title>角色分配</title>

        <link href="/Application/Admin/Public/css/mine.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
        <form name="form1" action="__SELF__" method="post">
            <dl>
            <!-- 遍历一级权限菜单 -->
            <foreach name="info1" item="vo1">
                <dt>
                    <label>
                        <if condition="in_array($vo1['auth_id'], $role_auth_id_array)">
                            <!-- 如果该角色拥有此权限，则选中 -->
                            <input type="checkbox" name="auth[]" value="{$vo1.auth_id}" checked="checked"/>
                        <else/>
                            <!-- 否则不选中 -->
                            <input type="checkbox" name="auth[]" value="{$vo1.auth_id}"/>
                        </if>
                        {$vo1.auth_name}
                    </label>
                </dt>
                <!-- 遍历二级权限菜单 -->
                <foreach name="info2" item="vo2">
                    <if condition="$vo2['auth_pid'] eq $vo1['auth_id']">
                        <dd>
                            <label>
                                <if condition="in_array($vo2['auth_id'], $role_auth_id_array)">
                                    <!-- 如果该角色拥有此权限，则选中 -->
                                    <input type="checkbox" name="auth[]" value="{$vo2.auth_id}" checked="checked"/>
                                <else/>
                                    <!-- 否则不选中 -->
                                    <input type="checkbox" name="auth[]" value="{$vo2.auth_id}"/>
                                </if>
                                {$vo2.auth_name}
                            </label>
                        </dd>
                    </if>
                </foreach>
            </foreach>
            </dl>
            <input type="submit" name="保存">
        </form>
    </body>
</html>